from django.http import HttpResponse
from django.shortcuts import redirect
from django.utils.deprecation import MiddlewareMixin
from django.shortcuts import render


class RedirectRootUrl(MiddlewareMixin):

    def process_request(self, request):
        if request.path_info == '/':
            return redirect('/goods/')

        return

    def process_response(self, request, response):
        # print("1走了")
        return response
